package com.yanqu.road.server.cmd.activity.recallplayer;

import com.yanqu.road.entity.activity.recallplayer.data.UserRecallOtherData;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.recallplayer.RecallPlayerModule;
import com.yanqu.road.server.manger.activity.recallplayer.RecallPlayerMgr;
import com.yanqu.road.server.protocol.GameProtocol;

import java.util.List;
import java.util.Map;

@Cmd(code = GameProtocol.S_RECALL_PLAYER_RECALL_OTHER_DATA_SYNC_REQ, desc = "请求同步召回他人信息同步")
public class RecallPlayerBindUserSyncReq extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        Map<Integer, List<UserRecallOtherData>> userBindOtherMap = RecallPlayerMgr.getUserRecallAllOtherData(player.getUserId());
        player.getModule(RecallPlayerModule.class).syncBindOtherData(userBindOtherMap);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
